package com.example.springstack.springboot.spring5.streamDemo;

import com.example.springstack.springboot.spring5.entity.StreamDemoUser;

import java.util.List;

/**
 * @author qiangfanghao
 * Stream 流各种实用用法记录
 * @date
 */
public interface StreamDemoService {

    /**
     * stream流排序
     *
     * @param streamDemoUsers
     */
    void streamSort(List<StreamDemoUser> streamDemoUsers);

    /**
     * 去重
     * @param streamDemoUsers
     */
    void streamDistinct(List<StreamDemoUser> streamDemoUsers);

    /**
     * Collectors 应用
     * @param streamDemoUsers
     */
    void streamCollectors(List<StreamDemoUser> streamDemoUsers);

    /**
     * 获取字符串中,指定字符的所有索引
     * @param testStr
     * @param flag
     */
    void intStreamIndex(String testStr,char flag);

}
